home *** CD-ROM | disk | FTP | other *** search
/ Chip 2007 January, February, March & April / Chip-Cover-CD-2007-02.iso / Pakiet bezpieczenstwa / mini Pentoo LiveCD 2006.1 / mpentoo-2006.1.iso / livecd.squashfs / usr / include / gtk-2.0 / gtk / gtkuimanager.h < prev    next >
Encoding:
C/C++ Source or Header  |  2006-04-25  |  5.9 KB  |  151 lines

  1. /*
  2.  * GTK - The GIMP Toolkit
  3.  * Copyright (C) 1998, 1999 Red Hat, Inc.
  4.  * All rights reserved.
  5.  *
  6.  * This Library is free software; you can redistribute it and/or
  7.  * modify it under the terms of the GNU Library General Public License as
  8.  * published by the Free Software Foundation; either version 2 of the
  9.  * License, or (at your option) any later version.
  10.  *
  11.  * This Library is distributed in the hope that it will be useful,
  12.  * but WITHOUT ANY WARRANTY; without even the implied warranty of
  13.  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
  14.  * Library General Public License for more details.
  15.  *
  16.  * You should have received a copy of the GNU Library General Public
  17.  * License along with the Gnome Library; see the file COPYING.LIB.  If not,
  18.  * write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
  19.  * Boston, MA 02111-1307, USA.
  20.  */
  21.  
  22. /*
  23.  * Author: James Henstridge <james@daa.com.au>
  24.  *
  25.  * Modified by the GTK+ Team and others 2003.  See the AUTHORS
  26.  * file for a list of people on the GTK+ Team.  See the ChangeLog
  27.  * files for a list of changes.  These files are distributed with
  28.  * GTK+ at ftp://ftp.gtk.org/pub/gtk/. 
  29.  */
  30. #ifndef __GTK_UI_MANAGER_H__
  31. #define __GTK_UI_MANAGER_H__
  32.  
  33.  
  34. #include <glib.h>
  35. #include <glib-object.h>
  36. #include <gtk/gtkaccelgroup.h>
  37. #include <gtk/gtkwidget.h>
  38. #include <gtk/gtkaction.h>
  39. #include <gtk/gtkactiongroup.h>
  40.  
  41. G_BEGIN_DECLS
  42.  
  43. #define GTK_TYPE_UI_MANAGER            (gtk_ui_manager_get_type ())
  44. #define GTK_UI_MANAGER(obj)            (G_TYPE_CHECK_INSTANCE_CAST ((obj), GTK_TYPE_UI_MANAGER, GtkUIManager))
  45. #define GTK_UI_MANAGER_CLASS(klass)    (G_TYPE_CHECK_CLASS_CAST ((klass), GTK_TYPE_UI_MANAGER, GtkUIManagerClass))
  46. #define GTK_IS_UI_MANAGER(obj)         (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GTK_TYPE_UI_MANAGER))
  47. #define GTK_IS_UI_MANAGER_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GTK_TYPE_UI_MANAGER))
  48. #define GTK_UI_MANAGER_GET_CLASS(obj)  (G_TYPE_INSTANCE_GET_CLASS((obj), GTK_TYPE_UI_MANAGER, GtkUIManagerClass))
  49.  
  50. typedef struct _GtkUIManager      GtkUIManager;
  51. typedef struct _GtkUIManagerClass GtkUIManagerClass;
  52. typedef struct _GtkUIManagerPrivate GtkUIManagerPrivate;
  53.  
  54.  
  55. struct _GtkUIManager {
  56.   GObject parent;
  57.  
  58.   /*< private >*/
  59.  
  60.   GtkUIManagerPrivate *private_data;
  61. };
  62.  
  63. struct _GtkUIManagerClass {
  64.   GObjectClass parent_class;
  65.  
  66.   /* Signals */
  67.   void (* add_widget)       (GtkUIManager *merge, 
  68.                              GtkWidget    *widget);
  69.   void (* actions_changed)  (GtkUIManager *merge);
  70.   void (* connect_proxy)    (GtkUIManager *merge,
  71.                  GtkAction    *action,
  72.                  GtkWidget    *proxy);
  73.   void (* disconnect_proxy) (GtkUIManager *merge,
  74.                  GtkAction    *action,
  75.                  GtkWidget    *proxy);
  76.   void (* pre_activate)     (GtkUIManager *merge,
  77.                  GtkAction    *action);
  78.   void (* post_activate)    (GtkUIManager *merge,
  79.                  GtkAction    *action);
  80.  
  81.   /* Virtual functions */
  82.   GtkWidget * (* get_widget) (GtkUIManager *manager,
  83.                               const gchar  *path);
  84.   GtkAction * (* get_action) (GtkUIManager *manager,
  85.                               const gchar  *path);
  86.  
  87.   /* Padding for future expansion */
  88.   void (*_gtk_reserved1) (void);
  89.   void (*_gtk_reserved2) (void);
  90. };
  91.  
  92. typedef enum {
  93.   GTK_UI_MANAGER_AUTO         = 0,
  94.   GTK_UI_MANAGER_MENUBAR      = 1 << 0,
  95.   GTK_UI_MANAGER_MENU         = 1 << 1,
  96.   GTK_UI_MANAGER_TOOLBAR      = 1 << 2,
  97.   GTK_UI_MANAGER_PLACEHOLDER  = 1 << 3,
  98.   GTK_UI_MANAGER_POPUP        = 1 << 4,
  99.   GTK_UI_MANAGER_MENUITEM     = 1 << 5,
  100.   GTK_UI_MANAGER_TOOLITEM     = 1 << 6,
  101.   GTK_UI_MANAGER_SEPARATOR    = 1 << 7,
  102.   GTK_UI_MANAGER_ACCELERATOR  = 1 << 8
  103. } GtkUIManagerItemType;
  104.  
  105. #ifdef G_OS_WIN32
  106. /* Reserve old name for DLL ABI backward compatibility */
  107. #define gtk_ui_manager_add_ui_from_file gtk_ui_manager_add_ui_from_file_utf8
  108. #endif
  109.  
  110. GType          gtk_ui_manager_get_type            (void) G_GNUC_CONST;
  111. GtkUIManager  *gtk_ui_manager_new                 (void);
  112. void           gtk_ui_manager_set_add_tearoffs    (GtkUIManager          *self,
  113.                            gboolean               add_tearoffs);
  114. gboolean       gtk_ui_manager_get_add_tearoffs    (GtkUIManager          *self);
  115. void           gtk_ui_manager_insert_action_group (GtkUIManager          *self,
  116.                            GtkActionGroup        *action_group,
  117.                            gint                   pos);
  118. void           gtk_ui_manager_remove_action_group (GtkUIManager          *self,
  119.                            GtkActionGroup        *action_group);
  120. GList         *gtk_ui_manager_get_action_groups   (GtkUIManager          *self);
  121. GtkAccelGroup *gtk_ui_manager_get_accel_group     (GtkUIManager          *self);
  122. GtkWidget     *gtk_ui_manager_get_widget          (GtkUIManager          *self,
  123.                            const gchar           *path);
  124. GSList        *gtk_ui_manager_get_toplevels       (GtkUIManager          *self,
  125.                            GtkUIManagerItemType   types);
  126. GtkAction     *gtk_ui_manager_get_action          (GtkUIManager          *self,
  127.                            const gchar           *path);
  128. guint          gtk_ui_manager_add_ui_from_string  (GtkUIManager          *self,
  129.                            const gchar           *buffer,
  130.                            gssize                 length,
  131.                            GError               **error);
  132. guint          gtk_ui_manager_add_ui_from_file    (GtkUIManager          *self,
  133.                            const gchar           *filename,
  134.                            GError               **error);
  135. void           gtk_ui_manager_add_ui              (GtkUIManager          *self,
  136.                            guint                  merge_id,
  137.                            const gchar           *path,
  138.                            const gchar           *name,
  139.                            const gchar           *action,
  140.                            GtkUIManagerItemType   type,
  141.                            gboolean               top);
  142. void           gtk_ui_manager_remove_ui           (GtkUIManager          *self,
  143.                            guint                  merge_id);
  144. gchar         *gtk_ui_manager_get_ui              (GtkUIManager          *self);
  145. void           gtk_ui_manager_ensure_update       (GtkUIManager          *self);
  146. guint          gtk_ui_manager_new_merge_id        (GtkUIManager          *self);
  147.  
  148. G_END_DECLS
  149.  
  150. #endif /* __GTK_UI_MANAGER_H__ */
  151.